package snake;

import com.jtattoo.plaf.hifi.HiFiLookAndFeel;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author Boogie
 */
public class MainGame extends JFrame {

    private SnakeGame g;

    public MainGame() {
        super("Snake");
              
        int size = 16 * 32;
        this.setSize(new Dimension(getInsets().left + getInsets().right + size+10,
                getInsets().top + getInsets().bottom + size + 60));
        this.setResizable(false);
    }

    public void startGame(int gameSpeed) {
        g = new SnakeGame(gameSpeed);
        this.add(g);  
        this.setVisible(true);
        g.requestFocus();;
        g.start();
    }

    public void stopGame(){
        g.stop();
    }

}
